/**
 * 
 */
package unifor.filetransfer.comandos;

import java.util.Map;

import org.swixat.commands.GuiCommand;
import org.swixat.model.GenericContext;

/**
 * @author Landim - Arthur Landim
 *
 */
public abstract class GenericAction implements GuiCommand {

    /* (non-Javadoc)
     * @see org.swixat.commands.GuiCommand#execute(java.lang.Object)
     */
    public Object execute(Object params) {
        
        try {
			action((GenericContext) params);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			return e;
		}
        
        return null;
    }
    
    public abstract void action(GenericContext context) throws Exception;
    
    public Map getMapParams(GenericContext context) {
        return (Map) context.getContext().get("idMap");
    }

}
